﻿<UserControl x:Class="ETRobocon.RaceTraking.GamePresentation.UserControlTeamNameAnimation"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:src="clr-namespace:ETRobocon.RaceTraking.GamePresentation"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 mc:Ignorable="d" 
			 Height="768" 
			 Width="1024" 
			 Name="NameAnimation" 
			 Background="{DynamicResource TeamNameAnimationBackgroundImage}" Opacity="0">
	
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="Styles/ResourceDictionary.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<!-- アニメーションに関する情報 -->
			<Storyboard x:Key="IntroductionStoryboard" AutoReverse="False" Completed="storyboard_Completed">
				<!-- ウィンドウのアニメーション -->
						<DoubleAnimation
							Storyboard.TargetName="NameAnimation"
							Storyboard.TargetProperty="Opacity"
							From="0" To="1"
							BeginTime="0:0:0"
							Duration="0:0:0.8"
						/>
						<DoubleAnimation
							Storyboard.TargetName="NameAnimation"
							Storyboard.TargetProperty="Width"
							From="0" To="1024"
							BeginTime="0:0:0"
							Duration="0:0:1"
						/>
						<!-- インコースチーム名のアニメーション -->
						<DoubleAnimation
							Storyboard.TargetName="TextInTeamName"
							Storyboard.TargetProperty="FontSize"
							From="0" To="180"
							BeginTime="0:0:1"
							Duration="0:0:1.5"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextInTeamName"
							Storyboard.TargetProperty="FontSize"
							From="180" To="200"
							BeginTime="0:0:2.5"
							Duration="0:0:0.35"
							AutoReverse="True" />
						<DoubleAnimation
							Storyboard.TargetName="TextInTeamName"
							Storyboard.TargetProperty="FontSize"
							From="180" To="100"
							BeginTime="0:0:3.2"
							Duration="0:0:0.8"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextInTeamName"
							Storyboard.TargetProperty="Opacity"
							From="0" To="1"
							BeginTime="0:0:1"
							Duration="0:0:1"
						/>
						<!-- アウトコースチーム名のアニメーション -->
						<DoubleAnimation
							Storyboard.TargetName="TextOutTeamName"
							Storyboard.TargetProperty="FontSize"
							From="0" To="180"
							BeginTime="0:0:1"
							Duration="0:0:1.5"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextOutTeamName"
							Storyboard.TargetProperty="FontSize"
							From="180" To="200"
							BeginTime="0:0:2.5"
							Duration="0:0:0.35"
							AutoReverse="True" />
						<DoubleAnimation
							Storyboard.TargetName="TextOutTeamName"
							Storyboard.TargetProperty="FontSize"
							From="180" To="100"
							BeginTime="0:0:3.2"
							Duration="0:0:0.8"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextOutTeamName"
							Storyboard.TargetProperty="Opacity"
							From="0" To="1"
							BeginTime="0:0:1"
							Duration="0:0:1"
						/>

						<!-- 浮かび上がる文字 -->
						<DoubleAnimation
							Storyboard.TargetName="TextInCourse"
							Storyboard.TargetProperty="Opacity"
							From="0" To="1"
							BeginTime="0:0:5"
							Duration="0:0:2.25"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextOutCourse"
							Storyboard.TargetProperty="Opacity"
							From="0" To="1"
							BeginTime="0:0:5"
							Duration="0:0:2.25"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextTurn"
							Storyboard.TargetProperty="Opacity"
							From="0" To="1"
							BeginTime="0:0:5"
							Duration="0:0:2.25"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextRound"
							Storyboard.TargetProperty="Opacity"
							From="0" To="1"
							BeginTime="0:0:5"
							Duration="0:0:2.25"
						/>
						<DoubleAnimation
							Storyboard.TargetName="Line1"
							Storyboard.TargetProperty="Opacity"
							From="0" To="1"
							BeginTime="0:0:5"
							Duration="0:0:2.25"
						/>
						<DoubleAnimation
							Storyboard.TargetName="Line2"
							Storyboard.TargetProperty="Opacity"
							From="0" To="1"
							BeginTime="0:0:5"
							Duration="0:0:2.25"
						/>

						<!-- 即終了を防ぐためのダミーアニメーション -->
						<!-- このアニメーション時間を長くすると、表示用画面が消えるまでの時間が長くなる -->
						<DoubleAnimation
							Storyboard.TargetName="NameAnimation"
							Storyboard.TargetProperty="Opacity"
							From="1" To="1"
							BeginTime="0:0:7.25"
							Duration="0:0:2"
						/>
						
						<!-- 終了処理 -->
						<!-- 文字を消すアニメーション -->
						<DoubleAnimation
							Storyboard.TargetName="TextInTeamName"
							Storyboard.TargetProperty="Opacity"
							From="1" To="0"
							BeginTime="0:0:9.25"
							Duration="0:0:1.5"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextOutTeamName"
							Storyboard.TargetProperty="Opacity"
							From="1" To="0"
							BeginTime="0:0:9.25"
							Duration="0:0:1.5"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextInCourse"
							Storyboard.TargetProperty="Opacity"
							From="1" To="0"
							BeginTime="0:0:9.25"
							Duration="0:0:1.5"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextOutCourse"
							Storyboard.TargetProperty="Opacity"
							From="1" To="0"
							BeginTime="0:0:9.25"
							Duration="0:0:1.5"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextTurn"
							Storyboard.TargetProperty="Opacity"
							From="1" To="0"
							BeginTime="0:0:9.25"
							Duration="0:0:1.5"
						/>
						<DoubleAnimation
							Storyboard.TargetName="TextRound"
							Storyboard.TargetProperty="Opacity"
							From="1" To="0"
							BeginTime="0:0:9.25"
							Duration="0:0:1.5"
						/>
						<DoubleAnimation
							Storyboard.TargetName="Line1"
							Storyboard.TargetProperty="Opacity"
							From="1" To="0"
							BeginTime="0:0:9.25"
							Duration="0:0:1.5"
						/>
						<DoubleAnimation
							Storyboard.TargetName="Line2"
							Storyboard.TargetProperty="Opacity"
							From="1" To="0"
							BeginTime="0:0:9.25"
							Duration="0:0:1.5"
						/>
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="TextVS">
					<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
					<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
					<EasingDoubleKeyFrame KeyTime="0:0:5" Value="1"/>
					<EasingDoubleKeyFrame KeyTime="0:0:9.2" Value="1"/>
					<EasingDoubleKeyFrame KeyTime="0:0:11" Value="0"/>
				</DoubleAnimationUsingKeyFrames>
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="TextVS">
					<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
					<EasingDoubleKeyFrame KeyTime="0:0:4" Value="5"/>
					<EasingDoubleKeyFrame KeyTime="0:0:5" Value="1"/>
					<EasingDoubleKeyFrame KeyTime="0:0:9.2" Value="1"/>
					<EasingDoubleKeyFrame KeyTime="0:0:11" Value="1"/>
				</DoubleAnimationUsingKeyFrames>
				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="TextVS">
					<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
					<EasingDoubleKeyFrame KeyTime="0:0:4" Value="5"/>
					<EasingDoubleKeyFrame KeyTime="0:0:5" Value="1"/>
					<EasingDoubleKeyFrame KeyTime="0:0:9.2" Value="1"/>
					<EasingDoubleKeyFrame KeyTime="0:0:11" Value="1"/>
				</DoubleAnimationUsingKeyFrames>
			</Storyboard>
		</ResourceDictionary>
	</UserControl.Resources>
	
	<UserControl.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard x:Name="IntroductionStoryboard_BeginStoryboard" Storyboard="{StaticResource IntroductionStoryboard}"/>
		</EventTrigger>
	</UserControl.Triggers>
	
	<Canvas>
		<!-- OUTコースチーム名 -->
		<TextBlock Margin="21,496,0,0" Height="212" HorizontalAlignment="Left" 
				   Name="TextOutTeamName" Text="OUTコースチーム名" VerticalAlignment="Top" FontSize="100" Width="991" Foreground="Khaki" TextAlignment="Right" FontWeight="Normal" Canvas.Left="0" Canvas.Top="2" Opacity="0">
			<TextBlock.BitmapEffect>
				<DropShadowBitmapEffect Color="Black"  ShadowDepth="5" Softness="0" />
			</TextBlock.BitmapEffect>
		</TextBlock>
		<!-- INコースチーム名 -->
		<TextBlock Margin="21,222,0,0" FontSize="100" FontWeight="Normal" Foreground="Khaki" Height="240" HorizontalAlignment="Left" 
				   Name="TextInTeamName" Text="INコースチーム名" TextAlignment="Left" VerticalAlignment="Top" Width="1000" Canvas.Left="-9" Opacity="0">
			<TextBlock.BitmapEffect>
				<DropShadowBitmapEffect Color="Black" ShadowDepth="5" Softness="0" />
			</TextBlock.BitmapEffect>
		</TextBlock>
		<!-- OUTコース -->
		<TextBlock FontSize="56" FontWeight="Normal" Foreground="Khaki" Height="64" HorizontalAlignment="Left" Margin="718,626,0,0" 
				   Name="TextOutCourse" Text="OUT COURSE" TextAlignment="Center" VerticalAlignment="Top" Width="294" FontFamily="Impact" Opacity="0" Canvas.Left="10">
			<TextBlock.BitmapEffect>
				<DropShadowBitmapEffect Color="Black" ShadowDepth="5" Softness="0" />
			</TextBlock.BitmapEffect>
		</TextBlock>
		<!-- INコース -->
		<TextBlock FontSize="56" FontWeight="Normal" Foreground="Khaki" Height="64" HorizontalAlignment="Left" Margin="21,154,0,0" 
				   Name="TextInCourse" Text="IN COURSE" TextAlignment="Center" VerticalAlignment="Top" Width="280" FontFamily="Impact" Opacity="0" Canvas.Top="5" Canvas.Left="-6">
			<TextBlock.BitmapEffect>
				<DropShadowBitmapEffect Color="Black" ShadowDepth="5" Softness="0" />
			</TextBlock.BitmapEffect>
		</TextBlock>
		<!-- Line -->
		<Rectangle Height="2" HorizontalAlignment="Left" Margin="12,98,0,0" Name="Line1" VerticalAlignment="Top" Width="1000" Fill="Khaki" Opacity="0" />
		<Rectangle Fill="Khaki" Height="2" HorizontalAlignment="Left" Margin="12,104,0,0" Name="Line2" VerticalAlignment="Top" Width="1000" Opacity="0" />
		<!-- ターン数 -->
		<TextBlock FontSize="80" FontWeight="Bold" Foreground="Khaki" Height="94" HorizontalAlignment="Left" Margin="14,12,0,0" Name="TextTurn" Text="TURN" TextAlignment="Left" VerticalAlignment="Top" Width="286" FontFamily="Impact" Opacity="0">
			<TextBlock.BitmapEffect>
				<DropShadowBitmapEffect Color="Black" ShadowDepth="5" Softness="0" />
			</TextBlock.BitmapEffect>
		</TextBlock>
		<!-- ラウンド数 -->
		<TextBlock FontFamily="Impact" FontSize="56" FontWeight="Normal" Foreground="Khaki" Height="94" HorizontalAlignment="Left" Margin="816,36,0,0" Name="TextRound" Text="ROUND" TextAlignment="Left" VerticalAlignment="Top" Width="196" Opacity="0">
			<TextBlock.BitmapEffect>
				<DropShadowBitmapEffect Color="Black" ShadowDepth="5" Softness="0" />
			</TextBlock.BitmapEffect>
		</TextBlock>
		<!-- VS -->
		<TextBlock FontSize="160" FontWeight="Normal" Foreground="Khaki" Name="TextVS" Text="VS" TextAlignment="Center" FontFamily="Impact" RenderTransformOrigin="0.5,0.5" Width="1024" Canvas.Top="346" Opacity="0">
			<TextBlock.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</TextBlock.RenderTransform>
			<TextBlock.BitmapEffect>
				<DropShadowBitmapEffect Color="Black" ShadowDepth="5" Softness="0" />
			</TextBlock.BitmapEffect>
		</TextBlock>
	</Canvas>
</UserControl>
